﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _1_4 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        
        ListBox3.Items.Add(ListBox1.SelectedItem);

        ListBox1.Items.RemoveAt(ListBox1.SelectedIndex);
        ListBox3.SelectedItem.Selected = false;
        ListBox1.ClearSelection();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        ListBox1.Items.Add(ListBox3.SelectedItem);

        ListBox3.Items.RemoveAt(ListBox3.SelectedIndex);
        ListBox1.SelectedItem.Selected = false;
        ListBox3.ClearSelection();
    }

    protected void Button3_Click(object sender, EventArgs e)
    {
        foreach(var x in ListBox1.Items)
        {
            ListBox3.Items.Add(x.ToString());
        }
        ListBox1.Items.Clear();
    }
}